package com.guangzhi.weijianzhi.http;

import org.apache.http.Header;

import android.content.res.Resources;
import android.support.v4.app.FragmentManager;

import com.guangzhi.weijianzhi.utils.Misc;
import com.guangzhi.weijianzhi.view.LodingFragmentDialog;
import com.loopj.android.http.AsyncHttpResponseHandler;

public  abstract  class  MyAsyncHttpResponseHandler extends AsyncHttpResponseHandler {
	
	private FragmentManager fragmentManager;

	public MyAsyncHttpResponseHandler(FragmentManager manager ,Resources resources){
	
		LodingFragmentDialog.showLodingDialog(manager, resources);
		this.fragmentManager = manager;
		
	}
	
	@Override
	public  void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) {
		// TODO Auto-generated method stub
		Misc.alertCenter("网络不给力,请检查网络!");
		LodingFragmentDialog.dismiss(fragmentManager);

	}

	@Override
	public   void onSuccess(int arg0, Header[] arg1, byte[] arg2) {
		// TODO Auto-generated method stub
		LodingFragmentDialog.dismiss(fragmentManager);
	}

}
